/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var xmlHttp;
var room = xmlHttp;

function getXmlHttpRequestObject() {
    if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
    } else if(window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        document.getElementById('status_div').innerHTML =
        'Status: Cound not create XmlHttpRequest Object.' +
    'Consider upgrading your browser.';
    }
    return null;
}

function GetXmlHttpObject() {
    var xmlHttp=null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}

function loadRoom() {
    room=GetXmlHttpObject();
    if (room==null) {
        alert ("Your browser does not support AJAX!");
        return;
    }
    url="roompanel.jsp";
    room.open("GET",url,true);
    room.onreadystatechange=function () {
        if (room.readyState==4){
            document.getElementById("ajaxroom").innerHTML=room.responseText;
        }
    };
    room.send(null);
    //setTimeout(loadRoom(), 10000);
}

